package lancs.mobilemedia.core.ui.controller;

import java.util.Hashtable;

import lancs.mobilemedia.core.ui.controller.commands.AddPhoto;
import lancs.mobilemedia.core.ui.controller.commands.DeletePhoto;
import lancs.mobilemedia.core.ui.controller.commands.EditLabel;
import lancs.mobilemedia.core.ui.controller.commands.GoToPreviousScreen;
import lancs.mobilemedia.core.ui.controller.commands.SaveAddedPhoto;
import lancs.mobilemedia.core.ui.controller.commands.SavePhotoLabel;
import lancs.mobilemedia.core.ui.controller.commands.ViewPhoto;

public class PhotoControllerMapper implements ControllerMapper {

	protected Hashtable commands;

	public PhotoControllerMapper() {
		commands = new Hashtable();
		commands.put("Back", new GoToPreviousScreen());
		commands.put("Cancel", new GoToPreviousScreen());
		init();
	}

	public ControllerCommand getCommand(String label) {
		return (ControllerCommand) commands.get(label);
	}

	public void init() {
		commands.put("Add", new AddPhoto());
		commands.put("Save Add Photo", new SaveAddedPhoto());
		commands.put("Delete", new DeletePhoto());
		commands.put("View", new ViewPhoto());
		commands.put("Edit Label", new EditLabel());
		commands.put("Save", new SavePhotoLabel());
	}

}
